package Test;

/**
 * @author Alger
 * @date 2021/9/7  8:20
 */
public class T7 {
    public static void main(String[] args) {
        System.out.println(bf(100));
    }
    public static int bf(int n){
        int count=0;
        //判断2到n-1有无可整除的数字
        for (int i = 2; i < n; i++) {
            count+=ifprime(i)?1:0;
        }
        return count;
    }

    private static boolean ifprime(int n) {
        for (int i = 2; i*i < n; i++) {
            if (n%i==0){
                return false;
            }
        }
        return true;
    }
}
